A foreign substance such as metal powder may be mixed in operation oil that transfers a supply pressure to an automatic shift for a vehicle. If the foreign substance gets into a clearance between a spool of an electromagnetic valve and a sleeve which receives the spool to slide, the foreign substance affects the operation of the spool. JP H11-82724A (U.S. Pat. No. 5,971,889) describes an oil pressure control device in which a foreign substance is removed by reciprocating the spool.
However, the reciprocation cycle of the spool is very slow such as three seconds in the oil pressure control device. In case where the spool is operated with such a low frequency while the spool has a reciprocation amplitude sufficient for removing a foreign substance, the supply pressure may be varied by the movement of the spool. A removal of foreign substance may not be performed in the oil pressure control device when the internal-combustion engine is operated, in consideration of a gear shift shock (vibration), while a removal of foreign substance can be performed when the internal-combustion engine stops.